package com.ruoyi.generator.config;

import com.ruoyi.generator.config.properties.GenConfigProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * 读取代码生成相关配置
 *
 * @author ruoyi
 */
@Component
public class GenConfig {

    private static GenConfigProperties genConfigProperties;

    @Autowired
    private GenConfigProperties genConfigPropertiesTemp;

    @PostConstruct
    public void init() {
        GenConfig.genConfigProperties = genConfigPropertiesTemp;
    }


    public static String getAuthor() {
        return genConfigProperties.getAuthor();
    }

    public static String getPackageName() {
        return genConfigProperties.getPackageName();
    }

    public static boolean getAutoRemovePre() {
        return genConfigProperties.isAutoRemovePrefix();
    }

    public static String getTablePrefix() {
        return genConfigProperties.getTablePrefix();
    }

}
